package com.weex.app.wxapi;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;

import com.tencent.mm.opensdk.constants.ConstantsAPI;
import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.weex.app.AbsWeexActivity;
import com.weex.app.R;
import com.weex.app.util.Constants;

import java.util.HashMap;
import java.util.Map;

public class WXPayEntryActivity extends AbsWeexActivity implements IWXAPIEventHandler {

	@Override
	public void onReq(BaseReq req) {
	}

	@SuppressLint("LongLogTag")
	@Override
	public void onResp(BaseResp resp) {
		if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
			Map<String,Object> params=new HashMap<>();
			params.put("pay","success");
			mInstance.fireGlobalEventCallback("payback",params);
		}
	}
}